package com.ihealthway.all.groupbuy.vo;

import io.github.elkan1788.mpsdk4j.vo.api.Follower;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

import java.util.Date;

/**
  * Bean class for user info design
 * @author 凡梦星尘(elkan1788@gmail.com)
 */
@Table("gb_user_info")
public class UserInfo {

    @Id
    @Column("u_id")
    private Integer userId;
    @Column("c_id")
    private Integer companyId;
    @One(target = Company.class, field = "companyId", key = "companyId")
    private Company company;
    @Column("open_id")
    private String openId;
    @Column("nick_name")
    private String nickName;
    @Column("real_name")
    private String realName;
    @Column("sex")
    private String sex;
    @Column("birthday")
    private String birthday;
    @Column("head_img")
    private String headImg;
    @Column("phone")
    private String phone;
    @Column("country")
    private String country;
    @Column("province")
    private String province;
    @Column("city")
    private String city;
    @Column("area")
    private String area;
    @Column("address")
    private String address;
    @Column("lang")
    private String lang;
   /* @Column("age")
    private Integer age;
    @One(target = SystemDict.class, field = "age", key = "dictId")
    private SystemDict ageDict;
    @Column("height")
    private Integer height;
    @One(target = SystemDict.class, field = "height", key = "dictId")
    private SystemDict heightDict;
    @Column("weight")
    private Integer weight;
    @One(target = SystemDict.class, field = "weight", key = "dictId")
    private SystemDict weightDict;*/
    @Column("remarks")
    private String remarks;
    @Column("follow_time")
    private Date followTime;
    @Column("unfollow_time")
    private Date unfollowTime;
    @Column("update_time")
    private Date updateTime;

    @Column("subscribe")
    private String subscribe;

    private String companyName;
    /*private String ageName;
    private String weightName;
    private String heightName;*/

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getLang() {
        return lang;
    }

    public void setLang(String lang) {
        this.lang = lang;
    }

    /*public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public SystemDict getAgeDict() {
        return ageDict;
    }

    public void setAgeDict(SystemDict ageDict) {
        this.ageDict = ageDict;
    }

    public Integer getHeight() {
        return height;
    }

    public void setHeight(Integer height) {
        this.height = height;
    }

    public SystemDict getHeightDict() {
        return heightDict;
    }

    public void setHeightDict(SystemDict heightDict) {
        this.heightDict = heightDict;
    }

    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public SystemDict getWeightDict() {
        return weightDict;
    }

    public void setWeightDict(SystemDict weightDict) {
        this.weightDict = weightDict;
    }*/

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Date getFollowTime() {
        return followTime;
    }

    public void setFollowTime(Date followTime) {
        this.followTime = followTime;
    }

    public Date getUnfollowTime() {
        return unfollowTime;
    }

    public void setUnfollowTime(Date unfollowTime) {
        this.unfollowTime = unfollowTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getSubscribe() {
        return subscribe;
    }

    public void setSubscribe(String subscribe) {
        this.subscribe = subscribe;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

   /* public String getAgeName() {
        if (this.ageDict != null) {
            this.ageName = this.ageDict.getDictName();
        }
        return ageName;
    }

    public void setAgeName(String ageName) {
        this.ageName = ageName;
    }

    public String getHeightName() {
        if (this.heightDict != null) {
            this.heightName = this.heightDict.getDictName();
        }
        return heightName;
    }

    public void setHeightName(String heightName) {
        this.heightName = heightName;
    }

    public String getWeightName() {
        if (this.weightDict != null) {
            this.weightName = this.weightDict.getDictName();
        }
        return weightName;
    }

    public void setWeightName(String weightName) {
        this.weightName = weightName;
    }
    */

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public void cloneFromFollower(Follower follower) {
        this.openId = follower.getOpenid();
        this.nickName = follower.getNickname();
        this.sex = Integer.toString(follower.getSex());
        this.headImg = follower.getHeadimgurl();
        this.lang = follower.getLanguage();
        this.country = follower.getCountry();
        this.province = follower.getProvince();
        this.city = follower.getCity();
        this.followTime = new Date(follower.getSubscribeTime() * 1000L);
        this.subscribe = Integer.toString(follower.getSubscribe());
    }

    @Override
    public String toString() {
        return "UserInfo{" +
                "userId=" + userId +
                ", companyId=" + companyId +
                ", openId='" + openId + '\'' +
                ", nickName=" + nickName +
                ", realName='" + realName + '\'' +
                ", sex='" + sex + '\'' +
                ", birthday='" + birthday + '\'' +
                ", headImg='" + headImg + '\'' +
                ", phone='" + phone + '\'' +
                ", country='" + country + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", lang='" + lang + '\'' +
               /* ", age=" + age +
                ", height=" + height +
                ", weight=" + weight +*/
                ", remarks='" + remarks + '\'' +
                ", followTime=" + followTime +
                ", unfollowTime=" + unfollowTime +
                ", subscribe=" + subscribe +
                '}';
    }
}
